/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-beijing = 'pai.cn-beijing.aliyuncs.com',
    cn-hangzhou = 'pai.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'pai.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'pai.cn-shenzhen.aliyuncs.com',
    cn-hongkong = 'pai.cn-hongkong.aliyuncs.com',
    ap-southeast-1 = 'pai.ap-southeast-1.aliyuncs.com',
    ap-southeast-2 = 'pai.ap-southeast-2.aliyuncs.com',
    ap-southeast-3 = 'pai.ap-southeast-3.aliyuncs.com',
    ap-southeast-5 = 'pai.ap-southeast-5.aliyuncs.com',
    us-west-1 = 'pai.us-west-1.aliyuncs.com',
    us-east-1 = 'pai.us-east-1.aliyuncs.com',
    eu-central-1 = 'pai.eu-central-1.aliyuncs.com',
    me-east-1 = 'pai.me-east-1.aliyuncs.com',
    ap-south-1 = 'pai.ap-south-1.aliyuncs.com',
    cn-qingdao = 'pai.cn-qingdao.aliyuncs.com',
    cn-zhangjiakou = 'pai.cn-zhangjiakou.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('paistudio', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CopyExperimentRequest {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  description?: string(name='Description', example='Pipeline draft description'),
  folderId?: string(name='FolderId', description='This parameter is required.', example='folder-erwx872xuryx'),
  name?: string(name='Name', description='This parameter is required.', example='Pipeline draft name'),
  source?: string(name='Source', example='PaiStudio'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='84972'),
}

model CopyExperimentResponseBody = {
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  requestId?: string(name='RequestId', example='6D161C28-9CB1-584E-8DD5-64441E32A5B3'),
}

model CopyExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CopyExperimentResponseBody(name='body'),
}

/**
 * @summary 复制实验
 *
 * @param request CopyExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CopyExperimentResponse
 */
async function copyExperimentWithOptions(ExperimentId: string, request: CopyExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CopyExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    body['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CopyExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/copy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 复制实验
 *
 * @param request CopyExperimentRequest
 * @return CopyExperimentResponse
 */
async function copyExperiment(ExperimentId: string, request: CopyExperimentRequest): CopyExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return copyExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model CreateExperimentRequest {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  description?: string(name='Description', example='Pipeline draft description'),
  folderId?: string(name='FolderId', description='This parameter is required.', example='folder-xfdafx093xxfd'),
  name?: string(name='Name', description='This parameter is required.', example='Pipeline draft name'),
  options?: string(name='Options', example='{"mlflow":{"experimentId":"exp-1"}}'),
  source?: string(name='Source', example='PaiStudio'),
  templateId?: string(name='TemplateId', example='template-xze5df2scrxxz'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='84972'),
}

model CreateExperimentResponseBody = {
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  requestId?: string(name='RequestId', example='42F23B58-3684-5443-848A-8DA81FF99712'),
}

model CreateExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentResponseBody(name='body'),
}

/**
 * @summary 创建实验，或根据实验模版创建实验
 *
 * @param request CreateExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentResponse
 */
async function createExperimentWithOptions(request: CreateExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    body['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.options)) {
    body['Options'] = request.options;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.templateId)) {
    body['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建实验，或根据实验模版创建实验
 *
 * @param request CreateExperimentRequest
 * @return CreateExperimentResponse
 */
async function createExperiment(request: CreateExperimentRequest): CreateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentWithOptions(request, headers, runtime);
}

model CreateExperimentFolderRequest {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  name?: string(name='Name', description='This parameter is required.', example='Pipeline draft name'),
  parentFolderId?: string(name='ParentFolderId', example='folder-xxfdjhfxdfad'),
  source?: string(name='Source', example='PaiStudio'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='45699'),
}

model CreateExperimentFolderResponseBody = {
  folderId?: string(name='FolderId', example='folder-xxfdjhfxduxd'),
  requestId?: string(name='RequestId', example='E7C42CC7-2E85-508A-84F4-923B605FD10F'),
}

model CreateExperimentFolderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentFolderResponseBody(name='body'),
}

/**
 * @summary 创建算法文件夹
 *
 * @param request CreateExperimentFolderRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentFolderResponse
 */
async function createExperimentFolderWithOptions(request: CreateExperimentFolderRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentFolderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    body['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.parentFolderId)) {
    body['ParentFolderId'] = request.parentFolderId;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentFolder',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentfolders`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建算法文件夹
 *
 * @param request CreateExperimentFolderRequest
 * @return CreateExperimentFolderResponse
 */
async function createExperimentFolder(request: CreateExperimentFolderRequest): CreateExperimentFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentFolderWithOptions(request, headers, runtime);
}

model CreateExperimentMigrateValidationRequest {
  sourceExpId?: long(name='SourceExpId', description='This parameter is required.', example='123'),
}

model CreateExperimentMigrateValidationResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model CreateExperimentMigrateValidationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentMigrateValidationResponseBody(name='body'),
}

/**
 * @summary 校验实验是否能迁移
 *
 * @param request CreateExperimentMigrateValidationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentMigrateValidationResponse
 */
async function createExperimentMigrateValidationWithOptions(request: CreateExperimentMigrateValidationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentMigrateValidationResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.sourceExpId)) {
    query['SourceExpId'] = request.sourceExpId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentMigrateValidation',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/migrate/experimentvalidation`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验实验是否能迁移
 *
 * @param request CreateExperimentMigrateValidationRequest
 * @return CreateExperimentMigrateValidationResponse
 */
async function createExperimentMigrateValidation(request: CreateExperimentMigrateValidationRequest): CreateExperimentMigrateValidationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentMigrateValidationWithOptions(request, headers, runtime);
}

model CreateJobRequest {
  executeType?: string(name='ExecuteType', example='EXECUTE_ALL'),
  experimentId?: string(name='ExperimentId', example='draft-o1p0k444nlq3cd50zz', deprecated=true),
  nodeId?: string(name='NodeId', example='id-2d88-1608982098027-91558'),
  options?: string(name='Options', example='{"mlflow":{"experimentId":"exp-1"}}'),
  pipelineDraftId?: string(name='PipelineDraftId', example='draft-o1p0k444nlq3cd50zz'),
}

model CreateJobResponseBody = {
  jobId?: string(name='JobId', example='job-jcs4mmyangk7r2zdqz'),
  requestId?: string(name='RequestId', example='85082123-2A3F-52E7-B27A-F04700B82FFB'),
}

model CreateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateJobResponseBody(name='body'),
}

/**
 * @summary 创建一个工作流的作业
 *
 * @param request CreateJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateJobResponse
 */
async function createJobWithOptions(request: CreateJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.executeType)) {
    body['ExecuteType'] = request.executeType;
  }
  if (!Util.isUnset(request.experimentId)) {
    body['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.nodeId)) {
    body['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.options)) {
    body['Options'] = request.options;
  }
  if (!Util.isUnset(request.pipelineDraftId)) {
    body['PipelineDraftId'] = request.pipelineDraftId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateJob',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建一个工作流的作业
 *
 * @param request CreateJobRequest
 * @return CreateJobResponse
 */
async function createJob(request: CreateJobRequest): CreateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createJobWithOptions(request, headers, runtime);
}

model DeleteExperimentResponseBody = {
  requestId?: string(name='RequestId', example='2ABF5D32-C9EE-55AE-92EE-DB08E8988AD3'),
}

model DeleteExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentResponseBody(name='body'),
}

/**
 * @summary 删除实验
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentResponse
 */
async function deleteExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除实验
 *
 * @return DeleteExperimentResponse
 */
async function deleteExperiment(ExperimentId: string): DeleteExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentWithOptions(ExperimentId, headers, runtime);
}

model DeleteExperimentFolderResponseBody = {
  requestId?: string(name='RequestId', example='F2D0392B-D749-5C48-A98A-3FAE5C9444A6'),
}

model DeleteExperimentFolderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentFolderResponseBody(name='body'),
}

/**
 * @summary 删除算法文件夹
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentFolderResponse
 */
async function deleteExperimentFolderWithOptions(FolderId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentFolderResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperimentFolder',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentfolders/${OpenApiUtil.getEncodeParam(FolderId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除算法文件夹
 *
 * @return DeleteExperimentFolderResponse
 */
async function deleteExperimentFolder(FolderId: string): DeleteExperimentFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentFolderWithOptions(FolderId, headers, runtime);
}

model GetAlgoTreeRequest {
  source?: string(name='Source', example='PaiStudio'),
}

model GetAlgoTreeResponseBody = {
  data?: map[string]any(name='Data', example='[{}]'),
  requestId?: string(name='RequestId', example='8CAA642F-EFEB-5F87-8F2F-ACD58B15FA03'),
}

model GetAlgoTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAlgoTreeResponseBody(name='body'),
}

/**
 * @summary 获取算法树
 *
 * @param request GetAlgoTreeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAlgoTreeResponse
 */
async function getAlgoTreeWithOptions(request: GetAlgoTreeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAlgoTreeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAlgoTree',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/algo/tree`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取算法树
 *
 * @param request GetAlgoTreeRequest
 * @return GetAlgoTreeResponse
 */
async function getAlgoTree(request: GetAlgoTreeRequest): GetAlgoTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAlgoTreeWithOptions(request, headers, runtime);
}

model GetAlgorithmDefRequest {
  algoVersion?: string(name='AlgoVersion', description='This parameter is required.', example='v1'),
  identifier?: string(name='Identifier', description='This parameter is required.', example='logisticregression_binary'),
  provider?: string(name='Provider', description='This parameter is required.', example='pai'),
  signature?: string(name='Signature', example='5vqe4Sgtzw8E6opyK3HkK+nzYlY='),
}

model GetAlgorithmDefResponseBody = {
  requestId?: string(name='RequestId', example='B4F16666-FD54-5D9D-A362-53A4C66692DF'),
  spec?: map[string]any(name='Spec', example='{}'),
}

model GetAlgorithmDefResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAlgorithmDefResponseBody(name='body'),
}

/**
 * @summary 获取算法定义
 *
 * @param request GetAlgorithmDefRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAlgorithmDefResponse
 */
async function getAlgorithmDefWithOptions(request: GetAlgorithmDefRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAlgorithmDefResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.algoVersion)) {
    query['AlgoVersion'] = request.algoVersion;
  }
  if (!Util.isUnset(request.identifier)) {
    query['Identifier'] = request.identifier;
  }
  if (!Util.isUnset(request.provider)) {
    query['Provider'] = request.provider;
  }
  if (!Util.isUnset(request.signature)) {
    query['Signature'] = request.signature;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAlgorithmDef',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/algorithm/def`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取算法定义
 *
 * @param request GetAlgorithmDefRequest
 * @return GetAlgorithmDefResponse
 */
async function getAlgorithmDef(request: GetAlgorithmDefRequest): GetAlgorithmDefResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAlgorithmDefWithOptions(request, headers, runtime);
}

model GetAlgorithmDefsRequest {
  latestTimestamp?: string(name='LatestTimestamp', example='1709950208'),
  rangeEnd?: int32(name='RangeEnd', example='10'),
  rangeStart?: int32(name='RangeStart', example='1'),
  timestamp?: string(name='Timestamp', example='1709950208'),
}

model GetAlgorithmDefsResponseBody = {
  requestId?: string(name='RequestId', example='F082BD0D-21E1-5F9B-81A0-AB07485B03CD'),
  specs?: [  map[string]any ](name='Specs'),
}

model GetAlgorithmDefsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAlgorithmDefsResponseBody(name='body'),
}

/**
 * @summary 批量获取算法定义
 *
 * @param request GetAlgorithmDefsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAlgorithmDefsResponse
 */
async function getAlgorithmDefsWithOptions(request: GetAlgorithmDefsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAlgorithmDefsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.latestTimestamp)) {
    query['LatestTimestamp'] = request.latestTimestamp;
  }
  if (!Util.isUnset(request.rangeEnd)) {
    query['RangeEnd'] = request.rangeEnd;
  }
  if (!Util.isUnset(request.rangeStart)) {
    query['RangeStart'] = request.rangeStart;
  }
  if (!Util.isUnset(request.timestamp)) {
    query['Timestamp'] = request.timestamp;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAlgorithmDefs',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/algorithm/defs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量获取算法定义
 *
 * @param request GetAlgorithmDefsRequest
 * @return GetAlgorithmDefsResponse
 */
async function getAlgorithmDefs(request: GetAlgorithmDefsRequest): GetAlgorithmDefsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAlgorithmDefsWithOptions(request, headers, runtime);
}

model GetAlgorithmTreeRequest {
  source?: string(name='Source', example='PaiStudio'),
  workspaceId?: string(name='WorkspaceId', example='12345'),
}

model GetAlgorithmTreeResponseBody = {
  requestId?: string(name='RequestId', example='46B59732-033F-5C96-9B15-1E05E7705548'),
  timestamp?: string(name='Timestamp', example='20210317101023'),
  tree?: [  map[string]any ](name='Tree'),
}

model GetAlgorithmTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAlgorithmTreeResponseBody(name='body'),
}

/**
 * @summary 获取算法树
 *
 * @param request GetAlgorithmTreeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAlgorithmTreeResponse
 */
async function getAlgorithmTreeWithOptions(request: GetAlgorithmTreeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAlgorithmTreeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAlgorithmTree',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/algorithm/tree`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取算法树
 *
 * @param request GetAlgorithmTreeRequest
 * @return GetAlgorithmTreeResponse
 */
async function getAlgorithmTree(request: GetAlgorithmTreeRequest): GetAlgorithmTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAlgorithmTreeWithOptions(request, headers, runtime);
}

model GetExperimentResponseBody = {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  content?: string(name='Content', example='{     "nodes": [         {             "id": "id-4c50-1609236241393-76174",             "name": "读数据表",             "metadata": {                 "identifier": "data_source",                 "version": "v1",                 "provider": "pai"             },             "properties": [                 {                     "name": "hasPartition",                     "value": false                 },                 {                     "name": "inputTableName",                     "value": "pai_online_project.e_commerce_test_data"                 }             ],             "position": {                 "x": 427,                 "y": 123             }         },         {             "id": "id-23ce-1609236252041-30106",             "name": "读数据表",             "metadata": {                 "identifier": "data_source",                 "version": "v1",                 "provider": "pai"             },             "properties": [                 {                     "name": "inputTableName",                     "value": "pai_online_project.e_commerce_train_data"                 },                 {                     "name": "hasPartition",                     "value": false                 }             ],             "position": {                 "x": 226,                 "y": 127             }         },         {             "id": "id-97a7-1609236275421-84245",             "name": "DeepFM",             "metadata": {                 "identifier": "deepfm",                 "version": "v1",                 "provider": "pai"             },             "properties": [                 {                     "name": "trainModel",                     "value": "train"                 },                 {                     "name": "arn",                     "value": true                 },                 {                     "name": "cluster",                     "value": "\\n{\\n    \\"ps\\": {\\n        \\"count\\": 2,\\n        \\"cpu\\": 1000,\\n        \\"memory\\": 40000\\n    },\\n    \\"worker\\": {\\n        \\"count\\": 8,\\n        \\"cpu\\": 1000,\\n        \\"memory\\": 40000\\n    }\\n}"                 }             ],             "position": {                 "x": 323,                 "y": 345             }         }     ],     "edges": [         {             "source": "id-23ce-1609236252041-30106",             "sourceAnchor": "outputTable",             "targetAnchor": "input1TableName",             "target": "id-97a7-1609236275421-84245"         },         {             "source": "id-4c50-1609236241393-76174",             "sourceAnchor": "outputTable",             "targetAnchor": "input2TableName",             "target": "id-97a7-1609236275421-84245"         }     ],     "globalParams": [],     "globalSettings": []  }'),
  creator?: string(name='Creator', example='1326689413376250'),
  description?: string(name='Description', example='Pipeline Draft Description'),
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-30T12:51:33.028Z'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-01-30T12:51:33.028Z'),
  name?: string(name='Name', example='Pipeline Draft Name'),
  options?: string(name='Options', example='{"mlflow":{"experimentId":"exp-1"}}'),
  requestId?: string(name='RequestId', example='DD405810-73C9-5721-996A-EA04BCC4BBF2'),
  source?: string(name='Source', example='PaiStudio'),
  version?: long(name='Version', example='12'),
  workspaceId?: string(name='WorkspaceId', example='23487'),
}

model GetExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentResponseBody(name='body'),
}

/**
 * @summary 获取实验信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentResponse
 */
async function getExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验信息
 *
 * @return GetExperimentResponse
 */
async function getExperiment(ExperimentId: string): GetExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentWithOptions(ExperimentId, headers, runtime);
}

model GetExperimentFolderChildrenRequest {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  onlyFolder?: boolean(name='OnlyFolder', example='true'),
  source?: string(name='Source', example='PaiStudio'),
  userId?: string(name='UserId', example='12345******13324'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model GetExperimentFolderChildrenResponseBody = {
  items?: [ 
    {
      empty?: boolean(name='Empty', example='false'),
      gmtCreateTime?: string(name='GmtCreateTime', description='Use the UTC time format: yyyy-MM-ddTHH:mmZ', example='2021-01-30T12:51:33.028Z'),
      gmtModifiedTime?: string(name='GmtModifiedTime', description='Use the UTC time format: yyyy-MM-ddTHH:mmZ', example='2021-01-30T12:51:33.028Z'),
      icon?: string(name='Icon', example='icon-folder'),
      id?: string(name='Id', example='folder-xzf7t7****ch7qce'),
      name?: string(name='Name', example='Pipeline draft name'),
      type?: string(name='Type', example='dir'),
    }
  ](name='Items'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  totalCount?: int32(name='TotalCount', example='23'),
}

model GetExperimentFolderChildrenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentFolderChildrenResponseBody(name='body'),
}

/**
 * @summary 获取算法文件夹下的内容
 *
 * @param request GetExperimentFolderChildrenRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentFolderChildrenResponse
 */
async function getExperimentFolderChildrenWithOptions(FolderId: string, request: GetExperimentFolderChildrenRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentFolderChildrenResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    query['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.onlyFolder)) {
    query['OnlyFolder'] = request.onlyFolder;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentFolderChildren',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentfolders/${OpenApiUtil.getEncodeParam(FolderId)}/children`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取算法文件夹下的内容
 *
 * @param request GetExperimentFolderChildrenRequest
 * @return GetExperimentFolderChildrenResponse
 */
async function getExperimentFolderChildren(FolderId: string, request: GetExperimentFolderChildrenRequest): GetExperimentFolderChildrenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentFolderChildrenWithOptions(FolderId, request, headers, runtime);
}

model GetExperimentMetaResponseBody = {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  creator?: string(name='Creator', example='1326****76250'),
  description?: string(name='Description', example='Pipeline draft description'),
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-30T12:51:33.028Z'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-01-30T12:51:33.028Z'),
  name?: string(name='Name', example='Pipeline draft name'),
  options?: string(name='Options', example='{"mlflow":{"experimentId":"exp-1"}}'),
  requestId?: string(name='RequestId', example='F2D0392B-D749-5C48-A98A-3FAE5C9444A6'),
  source?: string(name='Source', example='PaiStudio'),
  version?: string(name='Version', example='12'),
  workspaceId?: string(name='WorkspaceId', example='23487'),
}

model GetExperimentMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentMetaResponseBody(name='body'),
}

/**
 * @summary 获取实验的元信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentMetaResponse
 */
async function getExperimentMetaWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentMetaResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentMeta',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/meta`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验的元信息
 *
 * @return GetExperimentMetaResponse
 */
async function getExperimentMeta(ExperimentId: string): GetExperimentMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentMetaWithOptions(ExperimentId, headers, runtime);
}

model GetExperimentStatusResponseBody = {
  nodes?: [ 
    {
      finishedAt?: string(name='FinishedAt', example='2021-01-21T18:12:35.232Z'),
      jobId?: string(name='JobId', example='job-mewqhd72nsrqujn1px'),
      nodeId?: string(name='NodeId', example='id-2317-1608984201281-74996'),
      runId?: string(name='RunId', example='flow-wayrh3k605s7i51wey'),
      runNodeId?: string(name='RunNodeId', example='node-6hc0eocnmzf4pk9njc'),
      startedAt?: string(name='StartedAt', example='2021-01-21T17:12:35.232Z'),
      status?: string(name='Status', example='Running'),
    }
  ](name='Nodes'),
  requestId?: string(name='RequestId', example='18D5A1C6-14B8-545E-8408-0A7DDB4C6B5E'),
  status?: string(name='Status', example='Running'),
}

model GetExperimentStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentStatusResponseBody(name='body'),
}

/**
 * @summary 获取实验以及实验节点的状态
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentStatusResponse
 */
async function getExperimentStatusWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentStatusResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentStatus',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/status`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验以及实验节点的状态
 *
 * @return GetExperimentStatusResponse
 */
async function getExperimentStatus(ExperimentId: string): GetExperimentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentStatusWithOptions(ExperimentId, headers, runtime);
}

model GetExperimentVisualizationMetaRequest {
  nodeIds?: string(name='NodeIds', example='node_id1,node_id2'),
}

model GetExperimentVisualizationMetaResponseBody = {
  visualizationMeta?: [ 
    {
      meta?: string(name='Meta', example='{
	"locations": [{
		"id": "result_table",
		"location": {
			"project": "mulan_test_pre_1",
			"endpoint": "http://service.cn.maxcompute.aliyun-inc.com/api",
			"table": "pai_temp_flow_qzkkjqic95olnrel1w_node_7hc1rdsa99gy2msbvc_visualizationTable"
		},
		"locationType": "MaxComputeTable"
	}],
	"components": [{
		"id": "histogram-chart",
		"dataId": "histogram_result"
	}],
	"dataInfos": [{
		"id": "histogram_result",
		"locationId": "result_table",
		"dataType": "json"
	}]
}'),
      nodeId?: string(name='NodeId', example='node_id1'),
      nodeName?: string(name='NodeName'),
    }
  ](name='VisualizationMeta'),
  requestId?: string(name='requestId', example='A84A1282-D3E7-5198-9E8E-2AD09C78C6C1'),
}

model GetExperimentVisualizationMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentVisualizationMetaResponseBody(name='body'),
}

/**
 * @summary 查询实验的可视化meta
 *
 * @param request GetExperimentVisualizationMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentVisualizationMetaResponse
 */
async function getExperimentVisualizationMetaWithOptions(ExperimentId: string, request: GetExperimentVisualizationMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentVisualizationMetaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.nodeIds)) {
    query['NodeIds'] = request.nodeIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentVisualizationMeta',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/visualizationMeta`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询实验的可视化meta
 *
 * @param request GetExperimentVisualizationMetaRequest
 * @return GetExperimentVisualizationMetaResponse
 */
async function getExperimentVisualizationMeta(ExperimentId: string, request: GetExperimentVisualizationMetaRequest): GetExperimentVisualizationMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentVisualizationMetaWithOptions(ExperimentId, request, headers, runtime);
}

model GetExperimentsStatisticsRequest {
  source?: string(name='Source', example='PaiStudio'),
  workspaceIds?: string(name='WorkspaceIds', description='This parameter is required.', example='123,345'),
}

model GetExperimentsStatisticsResponseBody = {
  data?: [ 
    {
      createCount?: long(name='CreateCount', example='10'),
      totalCount?: long(name='TotalCount', example='20'),
      workspaceId?: string(name='WorkspaceId', example='16381'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model GetExperimentsStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentsStatisticsResponseBody(name='body'),
}

/**
 * @summary 获取实验的统计信息
 *
 * @param request GetExperimentsStatisticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentsStatisticsResponse
 */
async function getExperimentsStatisticsWithOptions(request: GetExperimentsStatisticsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentsStatisticsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceIds)) {
    query['WorkspaceIds'] = request.workspaceIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentsStatistics',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/statistics/experiments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验的统计信息
 *
 * @param request GetExperimentsStatisticsRequest
 * @return GetExperimentsStatisticsResponse
 */
async function getExperimentsStatistics(request: GetExperimentsStatisticsRequest): GetExperimentsStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentsStatisticsWithOptions(request, headers, runtime);
}

model GetExperimentsUsersStatisticsRequest {
  source?: string(name='Source', example='PaiStudio'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model GetExperimentsUsersStatisticsResponseBody = {
  requestId?: string(name='RequestId', example='F082BD0D-21E1-5F9B-81A0-AB07485B03CD'),
  users?: [ 
    {
      userId?: string(name='UserId', example='12345******67890'),
    }
  ](name='Users'),
}

model GetExperimentsUsersStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentsUsersStatisticsResponseBody(name='body'),
}

/**
 * @summary 获取实验或文件夹所有者列表
 *
 * @param request GetExperimentsUsersStatisticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentsUsersStatisticsResponse
 */
async function getExperimentsUsersStatisticsWithOptions(request: GetExperimentsUsersStatisticsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentsUsersStatisticsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentsUsersStatistics',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/statistics/experimentsusers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验或文件夹所有者列表
 *
 * @param request GetExperimentsUsersStatisticsRequest
 * @return GetExperimentsUsersStatisticsResponse
 */
async function getExperimentsUsersStatistics(request: GetExperimentsUsersStatisticsRequest): GetExperimentsUsersStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentsUsersStatisticsWithOptions(request, headers, runtime);
}

model GetJobRequest {
  verbose?: boolean(name='Verbose', example='true'),
}

model GetJobResponseBody = {
  arguments?: string(name='Arguments', example='---
arguments:
  parameters:
  - name: "execution_maxcompute"
    value:
      endpoint: "http://service.cn-shanghai.maxcompute.aliyun.com/api"
      odpsProject: "xxxxxxx"'),
  creator?: string(name='Creator', example='13266*******76250'),
  executeType?: string(name='ExecuteType', example='EXECUTE_TO_HERE'),
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-21T17:12:35.232Z'),
  jobId?: string(name='JobId', example='job-6xfhrofqx93y139fg3'),
  nodeId?: string(name='NodeId', example='id-xxxxx'),
  paiflowNodeId?: string(name='PaiflowNodeId', example='node-5dzotrnwyzfxmbwwc8'),
  requestId?: string(name='RequestId', example='18D5A1C6-14B8-545E-8408-0A7DDB4C6B5E'),
  runId?: string(name='RunId', example='flow-lcs8ez11961l6urc3m'),
  runInfo?: string(name='RunInfo', example='apiVersion: "core/v1"
metadata:
  version: "v1"
  identifier: "1de8f7c8-a9d8-4433-9e87-d95979ccab14"
  annotations: {}
spec:
  inputs:
    artifacts: []
    parameters:
    - name: "execution"
      type: "Map"
  arguments:
    artifacts: []
    parameters: []
  dependencies: []
  initContainers: []
  sideCarContainers: []
  pipelines:
  - apiVersion: "core/v1"
    metadata:
      provider: "pai"
      name: "id-2d88-1608982098027-91558"
      version: "v1"
      identifier: "type_transform"
      annotations: {}'),
  snapshot?: string(name='Snapshot', example='{}'),
  status?: string(name='Status', example='Succeeded'),
  workspaceId?: string(name='WorkspaceId', example='86995'),
}

model GetJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobResponseBody(name='body'),
}

/**
 * @summary 获取一个PAI Studio作业详情
 *
 * @param request GetJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobResponse
 */
async function getJobWithOptions(JobId: string, request: GetJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.verbose)) {
    query['Verbose'] = request.verbose;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJob',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/${OpenApiUtil.getEncodeParam(JobId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取一个PAI Studio作业详情
 *
 * @param request GetJobRequest
 * @return GetJobResponse
 */
async function getJob(JobId: string, request: GetJobRequest): GetJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobWithOptions(JobId, request, headers, runtime);
}

model GetMCTableSchemaRequest {
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model GetMCTableSchemaResponseBody = {
  columns?: [ 
    {
      name?: string(name='Name', example='column1'),
      preview?: [ string ](name='Preview'),
      type?: string(name='Type', example='STRING'),
    }
  ](name='Columns'),
  partitionColumns?: [ string ](name='PartitionColumns'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model GetMCTableSchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMCTableSchemaResponseBody(name='body'),
}

/**
 * @summary 获取MaxCompute表schema
 *
 * @param request GetMCTableSchemaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMCTableSchemaResponse
 */
async function getMCTableSchemaWithOptions(TableName: string, request: GetMCTableSchemaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetMCTableSchemaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMCTableSchema',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/datasources/maxcompute/tables/${OpenApiUtil.getEncodeParam(TableName)}/schema`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取MaxCompute表schema
 *
 * @param request GetMCTableSchemaRequest
 * @return GetMCTableSchemaResponse
 */
async function getMCTableSchema(TableName: string, request: GetMCTableSchemaRequest): GetMCTableSchemaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getMCTableSchemaWithOptions(TableName, request, headers, runtime);
}

model GetNodeInputSchemaRequest {
  inputId?: string(name='InputId', example='inputTable'),
  inputIndex?: int32(name='InputIndex', example='0'),
}

model GetNodeInputSchemaResponseBody = {
  colNames?: [ string ](name='ColNames'),
  colTypes?: [ string ](name='ColTypes'),
  requestId?: string(name='RequestId', example='CEB07647-8A5D-56F1-8B99-361BCF51402F'),
}

model GetNodeInputSchemaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNodeInputSchemaResponseBody(name='body'),
}

/**
 * @summary 获取实验节点输入桩的输入表的格式
 *
 * @param request GetNodeInputSchemaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNodeInputSchemaResponse
 */
async function getNodeInputSchemaWithOptions(ExperimentId: string, NodeId: string, request: GetNodeInputSchemaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetNodeInputSchemaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.inputId)) {
    query['InputId'] = request.inputId;
  }
  if (!Util.isUnset(request.inputIndex)) {
    query['InputIndex'] = request.inputIndex;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeInputSchema',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/nodes/${OpenApiUtil.getEncodeParam(NodeId)}/schema`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验节点输入桩的输入表的格式
 *
 * @param request GetNodeInputSchemaRequest
 * @return GetNodeInputSchemaResponse
 */
async function getNodeInputSchema(ExperimentId: string, NodeId: string, request: GetNodeInputSchemaRequest): GetNodeInputSchemaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getNodeInputSchemaWithOptions(ExperimentId, NodeId, request, headers, runtime);
}

model GetNodeOutputRequest {
  outputIndex?: string(name='OutputIndex', example='0'),
}

model GetNodeOutputResponseBody = {
  algoName?: string(name='AlgoName'),
  displayName?: string(name='DisplayName'),
  locationType?: string(name='LocationType', example='MaxComputeTable'),
  nodeName?: string(name='NodeName'),
  requestId?: string(name='RequestId', example='601FD8B1-78EB-5220-844C-92AC2EDAF7E1'),
  type?: string(name='Type', example='Model'),
  value?: map[string]any(name='Value', example='{
  "name": "model_flow_wayrh3k605s7i51wey_node_7n3tstbuhr36t0ukiz_model",
  "modelType": "OfflineModel",
  "labelCol": "_c2",
  "features": "pm10,so2,co,no2",
  "gmtCreateTime": "2021-01-21T17:12:35.232Z",
  "gmtModifiedTime": "2021-01-21T17:12:35.232Z",
  "parameters": {
    "epsilon": "0.000001",
    "enableSparse": "false",
    "regularizedLevel": "1",
    "roleArn": "true",
    "maxIter": "100",
    "regularizedType": "None",
    "generatePmml": "true"
  }
}'),
}

model GetNodeOutputResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetNodeOutputResponseBody(name='body'),
}

/**
 * @summary 获取某个节点的输出模型信息
 *
 * @param request GetNodeOutputRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetNodeOutputResponse
 */
async function getNodeOutputWithOptions(ExperimentId: string, NodeId: string, OutputId: string, request: GetNodeOutputRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetNodeOutputResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.outputIndex)) {
    query['OutputIndex'] = request.outputIndex;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetNodeOutput',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/nodes/${OpenApiUtil.getEncodeParam(NodeId)}/outputs/${OpenApiUtil.getEncodeParam(OutputId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某个节点的输出模型信息
 *
 * @param request GetNodeOutputRequest
 * @return GetNodeOutputResponse
 */
async function getNodeOutput(ExperimentId: string, NodeId: string, OutputId: string, request: GetNodeOutputRequest): GetNodeOutputResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getNodeOutputWithOptions(ExperimentId, NodeId, OutputId, request, headers, runtime);
}

model GetTemplateRequest {
  verbose?: boolean(name='Verbose'),
}

model GetTemplateResponseBody = {
  content?: string(name='Content', example='{     "metadata": {       "name": "实验名称",       "id": "pai_exp_xxxdfafafasfa",       "desc": "实验描述",     },     "nodes": [     ],     "edges": [     ],     "globalParams": [     ],     "globalSettings":[     ]  }'),
  description?: string(name='Description'),
  detail?: string(name='Detail'),
  docLink?: string(name='DocLink', example='URL://xxx'),
  imageLink?: string(name='ImageLink', example='URL://xxx'),
  labels?: [  map[string]any ](name='Labels'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  sourceId?: string(name='SourceId'),
  sourceType?: string(name='SourceType'),
  templateId?: string(name='TemplateId', example='template-12345'),
  templateType?: string(name='TemplateType'),
}

model GetTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTemplateResponseBody(name='body'),
}

/**
 * @summary 获取PAI Studio中指定模板
 *
 * @param request GetTemplateRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTemplateResponse
 */
async function getTemplateWithOptions(TemplateId: string, request: GetTemplateRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTemplateResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.verbose)) {
    query['Verbose'] = request.verbose;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTemplate',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/templates/${OpenApiUtil.getEncodeParam(TemplateId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取PAI Studio中指定模板
 *
 * @param request GetTemplateRequest
 * @return GetTemplateResponse
 */
async function getTemplate(TemplateId: string, request: GetTemplateRequest): GetTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTemplateWithOptions(TemplateId, request, headers, runtime);
}

model ListAuthRolesRequest {
  isGenerateToken?: string(name='IsGenerateToken', example='true'),
  workspaceId?: string(name='WorkspaceId', example='12345'),
}

model ListAuthRolesResponseBody = {
  requestId?: string(name='RequestId', example='8E2C1BB9-57C4-5051-9EF2-570ADC03A164'),
  roles?: [ 
    {
      isEnabled?: string(name='IsEnabled', example='true'),
      roleARN?: string(name='RoleARN', example='acs:ram::1557********904:role/aliyunodpspaidefaultrole'),
      roleName?: string(name='RoleName', example='AliyunODPSPAIDefaultRole'),
      roleType?: string(name='RoleType', example='PaiStudio。'),
      token?: {
        accessKeyId?: string(name='AccessKeyId', example='STS.NU************TT5LoC'),
        accessKeySecret?: string(name='AccessKeySecret', example='E1h2n66Duo1D**********c79JVk59R6i'),
        expiration?: string(name='Expiration', example='2021-03-19T19:14:42Z'),
        securityToken?: string(name='SecurityToken', example='CAISggJ1q6Ft5B2yf***************aAaDf+bmceH2MNtNe9XtmTXJytadQ2T0RT8uOA+4kSypOPxSHjdjmnQjbdA/Q9MyNtTErQ/m45RNsg=='),
      }(name='Token'),
    }
  ](name='Roles'),
}

model ListAuthRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAuthRolesResponseBody(name='body'),
}

/**
 * @summary 获取授权角色列表
 *
 * @param request ListAuthRolesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAuthRolesResponse
 */
async function listAuthRolesWithOptions(request: ListAuthRolesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAuthRolesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.isGenerateToken)) {
    query['IsGenerateToken'] = request.isGenerateToken;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAuthRoles',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/authorization/roles`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取授权角色列表
 *
 * @param request ListAuthRolesRequest
 * @return ListAuthRolesResponse
 */
async function listAuthRoles(request: ListAuthRolesRequest): ListAuthRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAuthRolesWithOptions(request, headers, runtime);
}

model ListExperimentsRequest {
  creator?: string(name='Creator', example='13266******376250'),
  experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
  name?: string(name='Name', example='Pipeline draft name'),
  order?: string(name='Order', example='DESC'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sortBy?: string(name='SortBy', example='GmtCreate'),
  source?: string(name='Source', example='PaiStudio'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='34875'),
}

model ListExperimentsResponseBody = {
  experiments?: [ 
    {
      accessibility?: string(name='Accessibility', example='PUBLIC'),
      creator?: string(name='Creator', example='1326*******76250'),
      description?: string(name='Description', example='Pipeline draft description'),
      experimentId?: string(name='ExperimentId', example='draft-rbvg5wzljzjhc9ks92'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-30T12:51:33.028Z'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-01-30T12:51:33.028Z'),
      name?: string(name='Name', example='Pipeline draft name'),
      source?: string(name='Source', example='PaiStudio'),
      version?: long(name='Version', example='12'),
      workspaceId?: string(name='WorkspaceId', example='23487'),
    }
  ](name='Experiments'),
  requestId?: string(name='RequestId', example='9708FB85-232F-5F9A-9D67-7F9CCCE20E06'),
  totalCount?: long(name='TotalCount', example='15'),
}

model ListExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentsResponseBody(name='body'),
}

/**
 * @summary 获取实验列表
 *
 * @param request ListExperimentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentsResponse
 */
async function listExperimentsWithOptions(request: ListExperimentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListExperimentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.creator)) {
    query['Creator'] = request.creator;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperiments',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取实验列表
 *
 * @param request ListExperimentsRequest
 * @return ListExperimentsResponse
 */
async function listExperiments(request: ListExperimentsRequest): ListExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listExperimentsWithOptions(request, headers, runtime);
}

model ListImageLabelsRequest {
  imageId?: string(name='ImageId'),
  labelFilter?: string(name='LabelFilter', example='a=b,c=d'),
  labelKeys?: string(name='LabelKeys', example='ImageType,Framework,Platform'),
}

model ListImageLabelsResponseBody = {
  labels?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Labels'),
  totalCount?: long(name='TotalCount', example='2'),
  requestId?: string(name='requestId'),
}

model ListImageLabelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListImageLabelsResponseBody(name='body'),
}

/**
 * @summary 列举标签
 *
 * @param request ListImageLabelsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListImageLabelsResponse
 */
async function listImageLabelsWithOptions(request: ListImageLabelsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListImageLabelsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.imageId)) {
    query['ImageId'] = request.imageId;
  }
  if (!Util.isUnset(request.labelFilter)) {
    query['LabelFilter'] = request.labelFilter;
  }
  if (!Util.isUnset(request.labelKeys)) {
    query['LabelKeys'] = request.labelKeys;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListImageLabels',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/image/labels`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 列举标签
 *
 * @param request ListImageLabelsRequest
 * @return ListImageLabelsResponse
 */
async function listImageLabels(request: ListImageLabelsRequest): ListImageLabelsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listImageLabelsWithOptions(request, headers, runtime);
}

model ListImagesRequest {
  labels?: string(name='Labels', example='Framework="Tensorflow 1.0",Framework="Tensorflow 2.0",Platform="GPU"'),
  name?: string(name='Name'),
  order?: string(name='Order'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
  verbose?: boolean(name='Verbose', example='true'),
}

model ListImagesResponseBody = {
  images?: [ 
    {
      description?: string(name='Description'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-21T17:12:35.232Z'),
      imageId?: string(name='ImageId', example='image-tzi7f9czc0cxs9s45t'),
      imageUri?: string(name='ImageUri'),
      labels?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Labels'),
      name?: string(name='Name'),
    }
  ](name='Images'),
  totalCount?: long(name='TotalCount', example='2'),
  requestId?: string(name='requestId'),
}

model ListImagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListImagesResponseBody(name='body'),
}

/**
 * @summary 列举已注册镜像
 *
 * @param request ListImagesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListImagesResponse
 */
async function listImagesWithOptions(request: ListImagesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListImagesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.verbose)) {
    query['Verbose'] = request.verbose;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListImages',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/images`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 列举已注册镜像
 *
 * @param request ListImagesRequest
 * @return ListImagesResponse
 */
async function listImages(request: ListImagesRequest): ListImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listImagesWithOptions(request, headers, runtime);
}

model ListJobsRequest {
  creator?: string(name='Creator', example='13266*******76250'),
  experimentId?: string(name='ExperimentId', description='This parameter is required.', example='draft-8up80bg0k1q23stml6'),
  order?: string(name='Order', example='DESC'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListJobsResponseBody = {
  jobs?: [ 
    {
      creator?: string(name='Creator', example='17677*******89598'),
      executeType?: string(name='ExecuteType', example='EXECUTE_ALL'),
      experimentId?: string(name='ExperimentId', example='draft-4x4iv3a9enuxw4vgka'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-01-21T17:12:35.232Z'),
      jobId?: string(name='JobId', example='job-mewqhd72nsrqujn1px'),
      nodeId?: string(name='NodeId', example='nodeId1'),
      paiflowNodeId?: string(name='PaiflowNodeId', example='node-xdfasf8ewxfdaddl'),
      runId?: string(name='RunId', example='flow-aayfouai80i980ncvz'),
      status?: string(name='Status', example='Running'),
      workspaceId?: string(name='WorkspaceId', example='94436'),
    }
  ](name='Jobs'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model ListJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobsResponseBody(name='body'),
}

/**
 * @summary 获取作业详情
 *
 * @param request ListJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobsResponse
 */
async function listJobsWithOptions(request: ListJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.creator)) {
    query['Creator'] = request.creator;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJobs',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取作业详情
 *
 * @param request ListJobsRequest
 * @return ListJobsResponse
 */
async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobsWithOptions(request, headers, runtime);
}

model ListNodeOutputsResponseBody = {
  outputs?: [ 
    {
      algoName?: string(name='AlgoName'),
      displayName?: string(name='DisplayName'),
      locationType?: string(name='LocationType', example='MaxComputeTable'),
      nodeName?: string(name='NodeName', example='node1'),
      outputId?: string(name='OutputId', example='outputModel'),
      outputIndex?: string(name='OutputIndex', example='0'),
      type?: string(name='Type', example='Model'),
      value?: map[string]any(name='Value', example='{
   "table": "table_name",
   "locationType": "MaxComputeTable"
}'),
    }
  ](name='Outputs'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model ListNodeOutputsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNodeOutputsResponseBody(name='body'),
}

/**
 * @summary 获取某个节点的输出模型列表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNodeOutputsResponse
 */
async function listNodeOutputsWithOptions(ExperimentId: string, NodeId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListNodeOutputsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListNodeOutputs',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/nodes/${OpenApiUtil.getEncodeParam(NodeId)}/outputs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某个节点的输出模型列表
 *
 * @return ListNodeOutputsResponse
 */
async function listNodeOutputs(ExperimentId: string, NodeId: string): ListNodeOutputsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listNodeOutputsWithOptions(ExperimentId, NodeId, headers, runtime);
}

model ListRecentExperimentsRequest {
  order?: string(name='Order', example='DESC'),
  pageNumber?: long(name='PageNumber', example='2'),
  pageSize?: long(name='PageSize', example='20'),
  source?: string(name='Source', example='PaiStudio'),
  type?: string(name='Type', example='Modified'),
  workspaceId?: string(name='WorkspaceId', example='86995'),
}

model ListRecentExperimentsResponseBody = {
  experiments?: [ 
    {
      description?: string(name='Description', example='Pipeline draft description'),
      experimentId?: string(name='ExperimentId', example='draft-76p70ye0gwv3vbur55'),
      modifyCnt?: long(name='ModifyCnt', example='10'),
      name?: string(name='Name', example='Pipeline draft name'),
      recentGmtModifiedTime?: string(name='RecentGmtModifiedTime', example='2021-01-30T12:51:33.028Z'),
      source?: string(name='Source', example='PaiStudio'),
      workspaceId?: string(name='WorkspaceId', example='15821'),
      workspaceName?: string(name='WorkspaceName', example='Workspace name'),
    }
  ](name='Experiments'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  totalCount?: long(name='TotalCount', example='23'),
}

model ListRecentExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRecentExperimentsResponseBody(name='body'),
}

/**
 * @summary 获取最近的实验
 *
 * @param request ListRecentExperimentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRecentExperimentsResponse
 */
async function listRecentExperimentsWithOptions(request: ListRecentExperimentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRecentExperimentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRecentExperiments',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/recentexperiments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取最近的实验
 *
 * @param request ListRecentExperimentsRequest
 * @return ListRecentExperimentsResponse
 */
async function listRecentExperiments(request: ListRecentExperimentsRequest): ListRecentExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRecentExperimentsWithOptions(request, headers, runtime);
}

model ListTemplatesRequest {
  label?: string(name='Label'),
  list?: string(name='List', example='types'),
  name?: string(name='Name'),
  order?: string(name='Order', example='DESC'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  sortBy?: string(name='SortBy'),
  source?: string(name='Source', example='PaiStudio'),
  tagId?: string(name='TagId', example='template-tag-12345'),
  templateType?: string(name='TemplateType'),
  typeId?: string(name='TypeId', example='template-type-12345'),
  verbose?: boolean(name='Verbose'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListTemplatesResponseBody = {
  requestId?: string(name='RequestId'),
  templateData?: [ 
    {
      template?: {
        content?: string(name='Content', example='{}'),
        creator?: string(name='Creator'),
        description?: string(name='Description'),
        detail?: string(name='Detail'),
        docLink?: string(name='DocLink', example='url://xxx'),
        gmtCreateTime?: string(name='GmtCreateTime', description='Use the UTC time format: yyyy-MM-ddTHH:mmZ'),
        gmtModifiedTime?: string(name='GmtModifiedTime', description='Use the UTC time format: yyyy-MM-ddTHH:mmZ'),
        imageLink?: string(name='ImageLink', example='url://xxx'),
        labels?: [  map[string]any ](name='Labels'),
        name?: string(name='Name'),
        templateId?: string(name='TemplateId', example='template-rbvg5wzljzjhc9ks92'),
      }(name='Template'),
      templateTag?: {
        name?: string(name='Name', example='PyTorch'),
        tagId?: string(name='TagId', example='template-tag-rbvg5wzljzjhc9ks92'),
        typeId?: string(name='TypeId', example='template-tag-type-rbvg5wzljzjhc9ks92'),
      }(name='TemplateTag'),
      templateType?: {
        name?: string(name='Name', example='行业分类'),
        typeId?: string(name='TypeId', example='templatetagtype-rbvg5wzljzjhc9ks92'),
      }(name='TemplateType'),
    }
  ](name='TemplateData'),
  totalCount?: int32(name='TotalCount', example='15'),
}

model ListTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTemplatesResponseBody(name='body'),
}

/**
 * @summary 获取PAI Studio中指定模板列表
 *
 * @param request ListTemplatesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTemplatesResponse
 */
async function listTemplatesWithOptions(request: ListTemplatesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTemplatesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.label)) {
    query['Label'] = request.label;
  }
  if (!Util.isUnset(request.list)) {
    query['List'] = request.list;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  if (!Util.isUnset(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  if (!Util.isUnset(request.typeId)) {
    query['TypeId'] = request.typeId;
  }
  if (!Util.isUnset(request.verbose)) {
    query['Verbose'] = request.verbose;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTemplates',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/templates`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取PAI Studio中指定模板列表
 *
 * @param request ListTemplatesRequest
 * @return ListTemplatesResponse
 */
async function listTemplates(request: ListTemplatesRequest): ListTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTemplatesWithOptions(request, headers, runtime);
}

model MigrateExperimentFoldersRequest {
  accessibility?: string(name='Accessibility', example='PRIVATE'),
  isOwner?: boolean(name='IsOwner', example='true'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model MigrateExperimentFoldersResponseBody = {
  code?: string(name='Code', example='NO_PERMISSION'),
  folderIdMapping?: map[string]object(name='FolderIdMapping'),
  message?: string(name='Message', example='SUCCESS'),
  requestId?: string(name='RequestId', example='9CFA2665-1FFE-5929-8468-C14C25890486'),
}

model MigrateExperimentFoldersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateExperimentFoldersResponseBody(name='body'),
}

/**
 * @summary 迁移PAI Studio 1.0的实验目录 
 *
 * @param request MigrateExperimentFoldersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateExperimentFoldersResponse
 */
async function migrateExperimentFoldersWithOptions(request: MigrateExperimentFoldersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): MigrateExperimentFoldersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    query['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.isOwner)) {
    query['IsOwner'] = request.isOwner;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MigrateExperimentFolders',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/migrate/folders`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 迁移PAI Studio 1.0的实验目录 
 *
 * @param request MigrateExperimentFoldersRequest
 * @return MigrateExperimentFoldersResponse
 */
async function migrateExperimentFolders(request: MigrateExperimentFoldersRequest): MigrateExperimentFoldersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return migrateExperimentFoldersWithOptions(request, headers, runtime);
}

model MigrateExperimentsRequest {
  accessibility?: string(name='Accessibility', example='PRIVATE'),
  destFolderId?: string(name='DestFolderId', description='This parameter is required.', example='folder-12321313'),
  isOwner?: boolean(name='IsOwner', example='true'),
  sourceExpId?: long(name='SourceExpId', description='This parameter is required.', example='12345'),
  updateIfExists?: boolean(name='UpdateIfExists', example='true'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model MigrateExperimentsResponseBody = {
  code?: string(name='Code', example='NO_PERMISSION'),
  data?: {
    alreadyExists?: boolean(name='AlreadyExists', example='true'),
    experimentId?: string(name='ExperimentId', example='draft-8u3ck2or5pw2i4auhf'),
    updated?: boolean(name='Updated', example='true'),
  }(name='Data'),
  message?: string(name='Message', example='NotExistError'),
  requestId?: string(name='RequestId', example='E7C42CC7-2E85-508A-84F4-923B605FD10F'),
}

model MigrateExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateExperimentsResponseBody(name='body'),
}

/**
 * @summary 迁移PAI Studio 1.0的实验
 *
 * @param request MigrateExperimentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateExperimentsResponse
 */
async function migrateExperimentsWithOptions(request: MigrateExperimentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): MigrateExperimentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    query['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.destFolderId)) {
    query['DestFolderId'] = request.destFolderId;
  }
  if (!Util.isUnset(request.isOwner)) {
    query['IsOwner'] = request.isOwner;
  }
  if (!Util.isUnset(request.sourceExpId)) {
    query['SourceExpId'] = request.sourceExpId;
  }
  if (!Util.isUnset(request.updateIfExists)) {
    query['UpdateIfExists'] = request.updateIfExists;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MigrateExperiments',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/migrate/experiments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 迁移PAI Studio 1.0的实验
 *
 * @param request MigrateExperimentsRequest
 * @return MigrateExperimentsResponse
 */
async function migrateExperiments(request: MigrateExperimentsRequest): MigrateExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return migrateExperimentsWithOptions(request, headers, runtime);
}

model PreviewMCTableRequest {
  endpoint?: string(name='Endpoint', description='This parameter is required.', example='http://service.cn-hangzhou-vpc.maxcompute.aliyun-inc.com/api'),
  limit?: int32(name='Limit', example='1000'),
  partition?: string(name='Partition', example='pt=20240805'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model PreviewMCTableResponseBody = {
  content?: [[ string ]  ](name='Content'),
  requestId?: string(name='RequestId', example='F082BD0D-21E1-5F9B-81A0-AB07485B03CD'),
}

model PreviewMCTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PreviewMCTableResponseBody(name='body'),
}

/**
 * @summary 预览Maxcompute表数据
 *
 * @param request PreviewMCTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PreviewMCTableResponse
 */
async function previewMCTableWithOptions(TableName: string, request: PreviewMCTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PreviewMCTableResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.endpoint)) {
    query['Endpoint'] = request.endpoint;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.partition)) {
    query['Partition'] = request.partition;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PreviewMCTable',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/datasources/maxcompute/tables/${OpenApiUtil.getEncodeParam(TableName)}/preview`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 预览Maxcompute表数据
 *
 * @param request PreviewMCTableRequest
 * @return PreviewMCTableResponse
 */
async function previewMCTable(TableName: string, request: PreviewMCTableRequest): PreviewMCTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return previewMCTableWithOptions(TableName, request, headers, runtime);
}

model PublishExperimentRequest {
  folderId?: string(name='FolderId', description='This parameter is required.', example='root'),
}

model PublishExperimentResponseBody = {
  requestId?: string(name='RequestId', example='5A26A7FA-EEF0-5A6B-BA76-06067547C11F'),
}

model PublishExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishExperimentResponseBody(name='body'),
}

/**
 * @summary 发布实验
 *
 * @param request PublishExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishExperimentResponse
 */
async function publishExperimentWithOptions(ExperimentId: string, request: PublishExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PublishExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PublishExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/publish`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 发布实验
 *
 * @param request PublishExperimentRequest
 * @return PublishExperimentResponse
 */
async function publishExperiment(ExperimentId: string, request: PublishExperimentRequest): PublishExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return publishExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model QueryExperimentVisualizationDataRequest {
  body?: [ 
    {
      endTime?: string(name='EndTime', example='2021-01-30T12:51:33.028Z'),
      nodeId?: string(name='NodeId', example='node-2dfd8xfjda'),
      startTime?: string(name='StartTime', example='2021-01-30T12:51:33.028Z'),
      visualizationDataIds?: [ string ](name='VisualizationDataIds'),
    }
  ](name='body', description='This parameter is required.'),
}

model QueryExperimentVisualizationDataResponseBody = {
  visualizationData?: [ 
    {
      createTime?: string(name='CreateTime', example='2021-01-30T12:51:33.028Z'),
      data?: string(name='Data', example='1,2,3,4,5'),
      dataId?: string(name='DataId', example='dataId1'),
      nodeId?: string(name='NodeId', example='node-ux55ier8axzo2xelcc'),
    }
  ](name='VisualizationData'),
  requestId?: string(name='requestId', example='FFB1D4B4-B253-540A-9B3B-AA711C48A1B7'),
}

model QueryExperimentVisualizationDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryExperimentVisualizationDataResponseBody(name='body'),
}

/**
 * @summary 查询实验的可视化数据
 *
 * @param request QueryExperimentVisualizationDataRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryExperimentVisualizationDataResponse
 */
async function queryExperimentVisualizationDataWithOptions(ExperimentId: string, request: QueryExperimentVisualizationDataRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryExperimentVisualizationDataResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = Util.toArray(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryExperimentVisualizationData',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/visualizationDataQuery`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询实验的可视化数据
 *
 * @param request QueryExperimentVisualizationDataRequest
 * @return QueryExperimentVisualizationDataResponse
 */
async function queryExperimentVisualizationData(ExperimentId: string, request: QueryExperimentVisualizationDataRequest): QueryExperimentVisualizationDataResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryExperimentVisualizationDataWithOptions(ExperimentId, request, headers, runtime);
}

model SearchMCTablesRequest {
  keyword?: string(name='Keyword', description='This parameter is required.', example='project.table_name_prefix'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='12345'),
}

model SearchMCTablesResponseBody = {
  requestId?: string(name='RequestId', example='18D5A1C6-14B8-545E-8408-0A7DDB4C6B5E'),
  tables?: [ string ](name='Tables'),
}

model SearchMCTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchMCTablesResponseBody(name='body'),
}

/**
 * @summary 搜索MaxCompute表
 *
 * @param request SearchMCTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchMCTablesResponse
 */
async function searchMCTablesWithOptions(request: SearchMCTablesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SearchMCTablesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchMCTables',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/datasources/maxcompute/tables`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 搜索MaxCompute表
 *
 * @param request SearchMCTablesRequest
 * @return SearchMCTablesResponse
 */
async function searchMCTables(request: SearchMCTablesRequest): SearchMCTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return searchMCTablesWithOptions(request, headers, runtime);
}

model StopExperimentResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model StopExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopExperimentResponseBody(name='body'),
}

/**
 * @summary 停止实验所有运行中的作业
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopExperimentResponse
 */
async function stopExperimentWithOptions(ExperimentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopExperimentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopExperiment',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 停止实验所有运行中的作业
 *
 * @return StopExperimentResponse
 */
async function stopExperiment(ExperimentId: string): StopExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopExperimentWithOptions(ExperimentId, headers, runtime);
}

model StopJobResponseBody = {
  requestId?: string(name='RequestId', example='431C53C4-BDD0-588F-8081-4437B00852B5'),
}

model StopJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopJobResponseBody(name='body'),
}

/**
 * @summary 停止一个实验的作业
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopJobResponse
 */
async function stopJobWithOptions(JobId: string, headers: map[string]string, runtime: Util.RuntimeOptions): StopJobResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'StopJob',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/${OpenApiUtil.getEncodeParam(JobId)}/stop`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 停止一个实验的作业
 *
 * @return StopJobResponse
 */
async function stopJob(JobId: string): StopJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopJobWithOptions(JobId, headers, runtime);
}

model UpdateExperimentContentRequest {
  content?: string(name='Content', description='This parameter is required.', example='{     "metadata": {       "name": "实验名称",       "id": "pai_exp_xxxdfafafasfa",       "desc": "实验描述",     },     "nodes": [     ],     "edges": [     ],     "globalParams": [     ],     "globalSettings":[     ]  }'),
  version?: long(name='Version', description='This parameter is required.', example='11'),
}

model UpdateExperimentContentResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  version?: long(name='Version', example='12'),
}

model UpdateExperimentContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentContentResponseBody(name='body'),
}

/**
 * @summary 更新实验内容
 *
 * @param request UpdateExperimentContentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentContentResponse
 */
async function updateExperimentContentWithOptions(ExperimentId: string, request: UpdateExperimentContentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentContentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.version)) {
    body['Version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentContent',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/content`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新实验内容
 *
 * @param request UpdateExperimentContentRequest
 * @return UpdateExperimentContentResponse
 */
async function updateExperimentContent(ExperimentId: string, request: UpdateExperimentContentRequest): UpdateExperimentContentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentContentWithOptions(ExperimentId, request, headers, runtime);
}

model UpdateExperimentFolderRequest {
  name?: string(name='Name', example='folder1'),
  parentFolderId?: string(name='ParentFolderId', example='folder-xzf7t785nka4c2334'),
}

model UpdateExperimentFolderResponseBody = {
  requestId?: string(name='RequestId', example='E7C42CC7-2E85-508A-84F4-923B605FD10F'),
}

model UpdateExperimentFolderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentFolderResponseBody(name='body'),
}

/**
 * @summary 更新算法文件夹
 *
 * @param request UpdateExperimentFolderRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentFolderResponse
 */
async function updateExperimentFolderWithOptions(FolderId: string, request: UpdateExperimentFolderRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentFolderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.parentFolderId)) {
    body['ParentFolderId'] = request.parentFolderId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentFolder',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentfolders/${OpenApiUtil.getEncodeParam(FolderId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新算法文件夹
 *
 * @param request UpdateExperimentFolderRequest
 * @return UpdateExperimentFolderResponse
 */
async function updateExperimentFolder(FolderId: string, request: UpdateExperimentFolderRequest): UpdateExperimentFolderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentFolderWithOptions(FolderId, request, headers, runtime);
}

model UpdateExperimentMetaRequest {
  accessibility?: string(name='Accessibility', example='PUBLIC'),
  description?: string(name='Description', example='Pipeline draft description'),
  folderId?: string(name='FolderId', example='folder-xfd782efd08wex'),
  name?: string(name='Name', example='Pipeline draft name'),
  options?: string(name='Options', example='{"mlflow":{"experimentId":"exp-1"}}'),
}

model UpdateExperimentMetaResponseBody = {
  requestId?: string(name='RequestId', example='18D5A1C6-14B8-545E-8408-0A7DDB4C6B5E'),
}

model UpdateExperimentMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentMetaResponseBody(name='body'),
}

/**
 * @summary 更新实验的Meta信息
 *
 * @param request UpdateExperimentMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentMetaResponse
 */
async function updateExperimentMetaWithOptions(ExperimentId: string, request: UpdateExperimentMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentMetaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessibility)) {
    body['Accessibility'] = request.accessibility;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.folderId)) {
    body['FolderId'] = request.folderId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.options)) {
    body['Options'] = request.options;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentMeta',
    version = '2021-02-02',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/meta`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新实验的Meta信息
 *
 * @param request UpdateExperimentMetaRequest
 * @return UpdateExperimentMetaResponse
 */
async function updateExperimentMeta(ExperimentId: string, request: UpdateExperimentMetaRequest): UpdateExperimentMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentMetaWithOptions(ExperimentId, request, headers, runtime);
}

